<!--A Design by W3layouts 
Author: W3layout
Author URL: http://w3layouts.com
License: Creative Commons Attribution 3.0 Unported
License URL: http://creativecommons.org/licenses/by/3.0/
-->
<!DOCTYPE html>
<html>
<head>
<title>梦幻婚礼——购物车</title>
<link href="css/bootstrap.css" rel="stylesheet" type="text/css"
	media="all" />
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="js/jquery.min.js"></script>
<script src="../res/layui/layui.js"></script>
<!-- Custom Theme files -->
<!--theme-style-->
<link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
<!--//theme-style-->
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords"
	content="Wedding Store Responsive web template, Bootstrap Web Templates, Flat Web Templates, Andriod Compatible web template, 
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
<script type="application/x-javascript">
	 addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } 
</script>
<!-- start menu -->
<script src="js/simpleCart.min.js">
	
</script>
<!-- start menu -->
<link href="css/memenu.css" rel="stylesheet" type="text/css" media="all" />
<script type="text/javascript" src="js/memenu.js"></script>
<script>
	$(document).ready(function() {
		$(".memenu").memenu();
	});
</script>
<!-- /start menu -->
</head>
<body>
	<!--header-->
	<div class="top_bg">
		<div class="container">
			<div class="header_top-sec">
				<div class="top_right">
					<ul>
						<li><a href="#">帮助</a></li>|
						<li><a href="contact.html">联系</a></li>|
						<li><a href="login.html">跟踪订单</a></li>
					</ul>
				</div>
				<div class="top_left">
					<ul>
						<li class="top_link">Email:<a href="mailto:info@example.com">mail@example.com</a></li>|
						<li class="top_link"><a href="vipcenter.html">我的账户</a></li>
						<li class="top_link"><a href="login.html">退出</a>
						<li>
					</ul>
				</div>
				<div class="clearfix"></div>
			</div>
		</div>
	</div>
	<div class="header-top">
		<div class="header-bottom">
			<div class="container">
				<div class="logo">
					<a href="index.html"><h1>梦幻婚礼</h1></a>
				</div>
				<!---->

				<div class="top-nav">
					<ul class="memenu skyblue">
						<li class="active"><a href="index.html">首页</a></li>
						<li class="grid"><a href="#">婚礼</a>
							<div class="mepanel">
								<div class="row">
									<div class="col1 me-one">
										<h4>商店</h4>
										<ul>
											<li><a href="product.html">New Arrivals</a></li>
											<li><a href="product.html">新郎</a></li>
											<li><a href="product.html">新娘</a></li>
											<li><a href="product.html">品牌</a></li>
											<li><a href="product.html">花童</a></li>
											<li><a href="product.html">登录</a></li>
											<li><a href="product.html">品牌</a></li>
											<li><a href="product.html">我的购物车</a></li>
										</ul>
									</div>
									<div class="col1 me-one">
										<h4>样式区域</h4>
										<ul>
											<li><a href="product.html">新郎</a></li>
											<li><a href="product.html">新娘</a></li>
											<li><a href="product.html">品牌</a></li>
											<li><a href="product.html">花童</a></li>
											<li><a href="product.html">配饰</a></li>
											<li><a href="product.html">拍摄风格</a></li>
										</ul>
									</div>
									<div class="col1 me-one">
										<h4>受欢迎的品牌</h4>
										<ul>

											<li><a href="product.html">李维斯</a></li>
											<li><a href="product.html">Nike</a></li>
											<li><a href="product.html">埃德温</a></li>

											<li><a href="product.html">杰克与琼斯</a></li>
											<li><a href="product.html">Paul Smith</a></li>
											<li><a href="product.html">Ray-Ban</a></li>
											<li><a href="product.html">木木材</a></li>
										</ul>
									</div>
								</div>
							</div></li>
						<li class="grid"><a href="#"></a>
							<div class="mepanel">
								<div class="row">
									<div class="col1 me-one">
										<h4>Shop</h4>
										<ul>
											<li><a href="product.html">New Arrivals</a></li>
											<li><a href="product.html">新郎</a></li>
											<li><a href="product.html">新娘</a></li>
											<li><a href="product.html">品牌</a></li>
											<li><a href="product.html">花童</a></li>
											<li><a href="product.html">登录</a></li>
											<li><a href="product.html">品牌</a></li>
											<li><a href="product.html">我的购物车</a></li>
										</ul>
									</div>
									<div class="col1 me-one">
										<h4>Style Zone</h4>
										<ul>
											<li><a href="product.html">新郎</a></li>
											<li><a href="product.html">新娘</a></li>
											<li><a href="product.html">品牌</a></li>
											<li><a href="product.html">花童</a></li>
											<li><a href="product.html">配饰</a></li>
											<li><a href="product.html">拍摄风格</a></li>
										</ul>
									</div>
									<div class="col1 me-one">
										<h4>Popular Brands</h4>
										<ul>
											<li><a href="product.html">李维斯</a></li>
											<li><a href="product.html">Nike</a></li>
											<li><a href="product.html">埃德温</a></li>

											<li><a href="product.html">杰克与琼斯</a></li>
											<li><a href="product.html">Paul Smith</a></li>
											<li><a href="product.html">Ray-Ban</a></li>
											<li><a href="product.html">木木材</a></li>
										</ul>
									</div>
								</div>
							</div></li>

						<li class="grid"><a href="contact.html">联系我们</a></li>
					</ul>
					<div class="clearfix"></div>
				</div>
				<!---->
				<div class="cart box_1">
					<a href="checkout.html">
						<h3>
							<div class="total">
								<span class="simpleCart_total"></span> (<span
									id="simpleCart_quantity" class="simpleCart_quantity"></span>)
							</div>
							<span class="glyphicon glyphicon-shopping-cart"
								aria-hidden="true"></span>
						</h3>
					</a>
					<p>
						<a  href="javascript:;" class="simpleCart_empty" lay-submit lay-filter="bt_qing">清空购物车</a>
					</p>
					<div class="clearfix"></div>
				</div>
				<div class="clearfix"></div>
				<!---->
			</div>
			<div class="clearfix"></div>
		</div>
	</div>
	<!---->
	<div class="checkout">
		<div class="container">
			<ol class="breadcrumb">
				<li><a href="index.html">首页</a></li>
				<li class="active">购物车</li>
			</ol>
			<div class="col-md-9 product-price1">
				<div class="check-out">
					<div class=" cart-items">
						<h3>我的购物车</h3>
						<script>
							$(document)
									.ready(
											function(c) {
												$('.close1')
														.on(
																'click',
																function(c) {
																	$(
																			'.cart-header')
																			.fadeOut(
																					'slow',
																					function(
																							c) {
																						$(
																								'.cart-header')
																								.remove();
																					});
																});
											});
						</script>
						<script>
							$(document)
									.ready(
											function(c) {
												$('.close2')
														.on(
																'click',
																function(c) {
																	$(
																			'.cart-header1')
																			.fadeOut(
																					'slow',
																					function(
																							c) {
																						$(
																								'.cart-header1')
																								.remove();
																				});
																});
											});
						</script>

						<div class="in-check">
							<ul class="unit">
								<li><span>产品</span></li>
								<li><span>产品名称</span></li>
								<li><span>单价</span></li>
								<li><span>库存状况</span></li>
								<li></li>
								<div class="clearfix"></div>
							</ul>

							<ul class="cart-header" id="jk">
								<!--<div class="close1"> </div>
							<li class="ring-in"><a href="single.html" ><img src="images/f1.jpg" class="img-responsive" alt=""></a>
							</li>
							<li><span>尖晶石项链</span></li>
							<li><span>$ 60.00</span></li>
							<li><span>有现货</span></li>
							<!--<li> <a href="single.html" class="add-cart cart-check">添加到购物车</a></li>-->
								<!--<div class="clearfix"> </div>
							</ul>
							<ul class=" cart-header1">
						   <div class="close2"> </div>
							<li class="ring-in"><a href="single.html" ><img src="images/f2.jpg" class="img-responsive" alt=""></a>
							</li>
							<li><span>昙花钻戒指</span></li>
							<li><span>$ 60.00</span></li>
							<li><span>有现货</span></li>
							<!--<li> <a href="single.html" class="add-cart cart-check">添加到购物车</a></li>-->
								<!--	<div class="clearfix"> </div>-->
							</ul>
						</div>

					</div>
				</div>
			</div>
			<div class="col-md-3 cart-total">
				<a class="continue" href="product.html">继续添加</a>
				<div class="price-details">
					<h3>价格明细：</h3>
					<span>总计：</span> <span class="total" id="gh"></span> <span>折扣：</span>
					<span class="total">---</span> <span>运费：</span> <span class="total">---</span>
					<div class="clearfix"></div>
				</div>
				<h4 class="last-price">总：</h4>
				<span class="total final" id="asd"></span>
				<div class="clearfix"></div>
				<a class="order" href="tianxieheduigouwuxinxi.html">下订单</a>

			</div>
		</div>
	</div>
	<!---->
	<div class="shoping">
		<div class="container">
			<div class="shpng-grids">
				<div class="col-md-4 shpng-grid">
					<h3>免费送货</h3>
					<p>订单满RS999</p>
				</div>
				<div class="col-md-4 shpng-grid">
					<h3>订单退货</h3>
					<p>14天内退货</p>
				</div>
				<div class="col-md-4 shpng-grid">
					<h3>付款方式</h3>
					<p>货到付款</p>
				</div>
				<div class="clearfix"></div>
			</div>
		</div>
	</div>
	<!---->
	<div class="footer">
		<div class="container">
			<div class="ftr-grids">
				<div class="col-md-3 ftr-grid">
					<h4>关于我们</h4>
					<ul>
						<li><a href="#">我们是谁</a></li>
						<li><a href="contact.html">联系我们</a></li>
						<li><a href="#">我们的网站</a></li>
						<li><a href="#">在新闻中</a></li>

					</ul>
				</div>
				<div class="col-md-3 ftr-grid">
					<h4>客户服务</h4>
					<ul>
						<li><a href="#">常问问题</a></li>
						<li><a href="#">运输</a></li>
						<li><a href="#">消除</a></li>
						<li><a href="#">退货</a></li>
						<li><a href="#">批量订单</a></li>
						<li><a href="#">购买指南</a></li>
					</ul>
				</div>
				<div class="col-md-3 ftr-grid">
					<h4>您的帐户</h4>
					<ul>
						<li><a href="account.html">您的帐户</a></li>
						<li><a href="#">个人信息</a></li>
						<li><a href="#">地址</a></li>
						<li><a href="#">折扣</a></li>
						<li><a href="#">追踪您的订单</a></li>
					</ul>
				</div>
				<div class="col-md-3 ftr-grid">
					<h4>分类目录</h4>
					<ul>
						<li><a href="#">>>婚礼</a></li>
						<li><a href="#">>>珠宝</a></li>
						<li><a href="#">>>鞋子</a></li>
						<li><a href="#">>>花</a></li>
						<li><a href="#">>>蛋糕</a></li>
						<li><a href="#">...更多</a></li>
					</ul>
				</div>
				<div class="clearfix"></div>
			</div>
		</div>
	</div>
	
	<!---->
	
	<script>
		function gethj(productz) {
			return "<div class='close1'></div>"
					+ "<li  class='ring-in'><a href='#'><img src='images/"+productz.picUrl+"' class='img-responsive' alt='' ></a>  "
					+ "</li>"
					+ "<li><span>"
					+ productz.pname
					+ "</span></li>"
					+ "<li><span>"
					+ productz.price
					+ "</span></li>"
					+ "<li><span>有现货</span></li>"
					+

					"<li> <a href='#' class='add-cart cart-check' data-car='"+productz.carId+"' lay-submit lay-filter='batchDel'>移除</a></li>"
					+ "<div class='clearfix'> "
					+"</div>"
			//							"<ul class=' cart-header1'>"+
			//					   "<div class='close2'> </div>"+
			////						"<li class='ring-in'><a href='single.html' ><img src='images/f2.jpg' class='img-responsive' alt=''></a>"+
			//						"</li>"+
			////							"<li><span>"+productz.pname+"</span></li>"+
			////							"<li><span>"+productz.price+"</span></li>"+
			////							"<li> <a href='single.html' class='add-cart cart-check'>添加到购物车</a></li>"+
			//							"<div class='clearfix'> </div>"
		}
		var sum = 0;
		//添加form的弹窗索引
		var indexOfAddForm;
		//编辑form的弹窗索引
		var indexOfEditForm;
		layui.use([ 'table', 'layer', 'laydate', 'form' ], function() {
			var table = layui.table;
			var layer = layui.layer;
			var form = layui.form;
			var laydate = layui.laydate;
			var $ = layui.$;
			$.post("/g4/carproduct/selectall", {}, function(res) {
				if (res.code === '0') {
					for (var i = 0; i < res.data.length; i++) {
						sum += res.data[i].price;
						console.log(sum);
						$("#gh").html(sum)
						$("#asd").html(sum)

						var code = gethj(res.data[i]);
						$("#jk").append($(code));
					}
				} else {
					layer.msg("获取失败")
				}
			}, 'json')
			
			   form.on('submit(batchDel)', function(data) {
										var car =  $(this).data("car");
										layer.confirm('真的删除行么', function(index) {
											var url = "/g4/carproduct/hjk";
					                         var dt = {
					                        		 carId:car
											}
											$.post(url, dt, function(res) {
												if (res.code == '0') {
													layer.msg('删除成功');
										
												} else {
													layer.msg('删除失败');
												}
											}, 'json')
										})
											});
					form.on('submit(bt_qing)', function(data) {
					layer.confirm('真的要清空吗？', function(index) {
						var url = "/g4/carproduct/qingkong";
						$.post(url,{}, function(res) {
							if (res.code == '0') {
								layer.msg("已清空")
								
							} else {
								layer.msg("清空失败")
							}
						}, 'json')

						layer.close(index);

						return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
					});
				});
								   


	});
	</script>
</body>
</html>